with SDL; use SDL;
package body CairoSDL is

   function To_Cairo (C : SDL.Video.Color_t) return Cairo_Color_Type
   is
      pragma Inline(To_Cairo);

      function Cast (X : SDL.Uint8_t) return Float_Color 
      is
         pragma Inline(Cast);
      begin
         return double(X) / 255.0;
      end Cast;
   begin
      return (R => Cast(C.R), G => Cast(C.G), B => Cast(C.B), A => Cast(C.A));
   end To_Cairo;

   function To_Cairo (R : SDL.Video.Rect_t) return Cairo.Cairo_Rectangle
   is
   begin
      return (double(R.x), double(R.y), double(R.W), double(R.H));
   end To_Cairo;
end CairoSDL;
